/*
 * @Author: Tower-7
 * @Date: 2022-10-09 11:57:15
 * @LastEditors: Tower-7
 * @LastEditTime: 2022-10-10 19:23:01
 * @Description:
 */
import { createSSRApp } from "vue";
import store from "./store/index.ts";
import App from "./App.vue";
import "./static/css/style.scss";
/**
 引入全局方法/属性
 */
import config from "./config/index";
import baseUrl from "./config/config";
import utils from "./utils/index";
/**
 引入全局组件
 */
import ttStatusBar from "@/components/tt-status-bar.vue";
import ttLoading from "@/components/loading.vue";
import ttEmpty from "@/components/tt-empty.vue";
import ttCity from "@/components/tt-city/index.vue";
import ttSearch from "@/components/tt-search/index.vue";
import ttLogin from "@/components/login.vue";
import pageLogin from "@/components/page-login.vue";
import ttUpload from "@/components/upload.vue";
import uploadNostyle from "@/components/upload-nostyle.vue";
import ttBack from "@/components/tt-back.vue";
import cssLoading from "@/components/css-loading.vue";
import add from "@/components/add.vue";
import pageBottom from "@/components/page-bottom.vue";
import goTop from "@/components/go-top.vue";
import safeBottom from "@/components/safe-bottom.vue";

export function createApp() {
  const app = createSSRApp(App);
  app.use(store);
  // 全局方法/属性 proxy.$images

  app.config.globalProperties.$utils = utils;
  app.config.globalProperties.$config = config;
  app.config.globalProperties.$baseUrl = baseUrl;

  /**
    全局组件注入
 */
  // #ifdef MP-WEIXIN
  app.component("ttStatusBar", ttStatusBar);
  // #endif
  app.component("ttLoading", ttLoading);
  app.component("ttEmpty", ttEmpty);
  app.component("ttCity", ttCity);
  app.component("ttSearch", ttSearch);
  app.component("ttLogin", ttLogin);
  app.component("pageLogin", pageLogin);
  app.component("ttUpload", ttUpload);
  app.component("uploadNostyle", uploadNostyle);
  app.component("ttBack", ttBack);
  app.component("cssLoading", cssLoading);
  app.component("add", add);
  app.component("pageBottom", pageBottom);
  app.component("goTop", goTop);
  app.component("safeBottom", safeBottom);

  return {
    app,
  };
}
